package com.jic.market.enums;

/**
 * 优惠券的互斥组类型，组内都互斥，组外按顺序
 * @author yinhaijun
 * @date: 2020/4/28
 */
public enum MutuallyExclusiveTypeEnum {

    PLATFORM_COUPON_AMOUNT(1, "平台-金额劵"),
    STORE_COUPON_AMOUNT(3, "店铺-金额劵"),
    COUPON_PROXY_AMOUNT(2, "代金券（分为平台劵和店铺劵）"),
    COUPON_FREIGHT(4, "运费劵（分为平台劵和店铺劵）"),
    ;
    private Integer code;
    private String message;

    MutuallyExclusiveTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static MutuallyExclusiveTypeEnum getByCode(Integer code) {
        MutuallyExclusiveTypeEnum[] values = MutuallyExclusiveTypeEnum.values();
        for (MutuallyExclusiveTypeEnum value : values) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
